Skip to content

♻️ refactor(payments): use Notification service for emails ⚠️ 🚨#9042

Merged
giancarloromeo merged 56 commits intoITISFoundation:masterfrom
giancarloromeo:refactor/use-notification-service-for-emails-in-payments
Apr 23, 2026
Merged

♻️ refactor(payments): use Notification service for emails ⚠️ 🚨#9042
giancarloromeo merged 56 commits intoITISFoundation:masterfrom
giancarloromeo:refactor/use-notification-service-for-emails-in-payments

Conversation

@giancarloromeo
Copy link
Copy Markdown
Contributor

@giancarloromeo giancarloromeo commented Apr 20, 2026

What do these changes do?

This pull request refactors payment confirmation emails to be sent through the notifications service (via RabbitMQ RPC + notifications worker) instead of direct SMTP rendering/sending in the payments service, and introduces support for email BCC and attachments across the notifications pipeline.

Before

image

After

image

Related issue/s

How to test

cd services/payments
make install-dev

pytest -vv --pdb tests/unit/test_services_notifier.py
pytest -vv --pdb tests/unit/test_services_notifier_email.py

cd services/notifications
make install-dev

pytest -vv --pdb tests/unit/test_api_celery_send_email.py
pytest -vv --pdb tests/unit/test_api_rpc_template.py
pytest -vv --pdb test_channel_handlers_email.py

Dev-ops

  • PAYMENTS_EMAIL env var is not used anymore (MR 1989).

@giancarloromeo giancarloromeo added this to the Etna milestone Apr 20, 2026
@giancarloromeo giancarloromeo self-assigned this Apr 20, 2026
@giancarloromeo giancarloromeo added a:payments area: payments service a:notifications labels Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.41%. Comparing base (4ed60a0) to head (7565171).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9042      +/-   ##
==========================================
+ Coverage   87.40%   87.41%   +0.01%     
==========================================
  Files        2057     2058       +1     
  Lines       81070    81063       -7     
  Branches     1461     1461              
==========================================
+ Hits        70856    70860       +4     
+ Misses       9803     9792      -11     
  Partials      411      411              
Flag Coverage Δ
integrationtests 63.89% <ø> (-0.01%) ⬇️
unittests 86.27% <96.87%> (+<0.01%) ⬆️
Components Coverage Δ
pkg_aws_library 95.29% <ø> (ø)
pkg_celery_library 77.72% <ø> (ø)
pkg_dask_task_models_library 79.65% <ø> (ø)
pkg_models_library 92.66% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library 84.48% <ø> (ø)
pkg_postgres_database 89.91% <ø> (ø)
pkg_service_integration 72.81% <ø> (ø)
pkg_service_library 70.41% <ø> (ø)
pkg_settings_library 90.48% <ø> (ø)
pkg_simcore_sdk 86.00% <ø> (ø)
agent 93.26% <ø> (ø)
api_server 91.40% <ø> (ø)
autoscaling 95.48% <ø> (ø)
catalog 92.10% <ø> (ø)
clusters_keeper 98.59% <ø> (ø)
dask_sidecar 91.53% <ø> (-0.22%) ⬇️
datcore_adapter 97.95% <ø> (ø)
director 75.45% <ø> (ø)
director_v2 91.71% <ø> (+0.01%) ⬆️
dynamic_scheduler 95.77% <ø> (ø)
dynamic_sidecar 87.96% <ø> (ø)
efs_guardian 89.73% <ø> (ø)
invitations 90.93% <ø> (ø)
payments 92.43% <95.23%> (-0.44%) ⬇️
resource_usage_tracker 92.87% <ø> (+0.41%) ⬆️
storage 86.94% <ø> (+0.16%) ⬆️
webclient ∅ <ø> (∅)
webserver 86.79% <ø> (+0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ed60a0...7565171. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This comment was marked as resolved.

…s' of github.com:giancarloromeo/osparc-simcore into refactor/use-notification-service-for-emails-in-payments
@giancarloromeo giancarloromeo requested a review from Copilot April 22, 2026 09:01

This comment was marked as resolved.

This comment was marked as resolved.

@giancarloromeo giancarloromeo changed the title ♻️ refactor(payments): use notification service for emails ♻️ refactor(payments): use notification service for emails ⚠️ Apr 22, 2026
…s' of github.com:giancarloromeo/osparc-simcore into refactor/use-notification-service-for-emails-in-payments
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅

Copy link
Copy Markdown
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at my comment and thanks for considering it.

Comment thread services/payments/scripts/example_payment_gateway.py
@giancarloromeo giancarloromeo changed the title ♻️ refactor(payments): use notification service for emails ⚠️ 🚨 ♻️ refactor(payments): use Notification service for emails ⚠️ 🚨 Apr 23, 2026
Copy link
Copy Markdown
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I reviewed properly this time ;) looking good, lets test it in aws master when it is deployed - you can buy credits with a fake credit card and this should initialize this email .

We can test both cases, successful but also unsuccessful payment - please let me know when it is in master and we can do it together.

@giancarloromeo
Copy link
Copy Markdown
Contributor Author

Thanks! I reviewed properly this time ;) looking good, lets test it in aws master when it is deployed - you can buy credits with a fake credit card and this should initialize this email .

Yep, I know. Already tested with example_payments_gateway locally... but I put 🚨 in the title to remember that it will require Manual tests also when deployed :)

Thanks for reviewing it 🙏

Copy link
Copy Markdown
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx.

Left some comments. Please keep an eye on them.

Comment thread services/payments/src/simcore_service_payments/services/notifier_email.py Outdated
Comment thread services/payments/src/simcore_service_payments/services/notifier_email.py Outdated
Comment thread services/payments/src/simcore_service_payments/services/notifier_email.py Outdated
Comment thread services/payments/src/simcore_service_payments/services/notifier_email.py Outdated
giancarloromeo and others added 7 commits April 23, 2026 16:40
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@sonarqubecloud
Copy link
Copy Markdown

@giancarloromeo giancarloromeo enabled auto-merge (squash) April 23, 2026 17:29
@giancarloromeo
Copy link
Copy Markdown
Contributor Author

@mergify queue

@giancarloromeo giancarloromeo added the 🤖-automerge marks PR as ready to be merged for Mergify label Apr 23, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 23, 2026

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Waiting for:
  • -closed
All conditions
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [📌 queue requirement]:
    • check-neutral = Mergify Merge Protections
    • check-skipped = Mergify Merge Protections
    • check-success = Mergify Merge Protections
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue rule default]:
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of [🛡 GitHub branch protection]:
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of [🛡 GitHub branch protection]:
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of [🛡 GitHub branch protection]:
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of [🛡 GitHub branch protection]:
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of [🛡 GitHub branch protection]:
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of [🛡 GitHub branch protection]:
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images
      • any of [🛡 GitHub branch protection]:
        • check-success = SonarCloud Code Analysis
        • check-neutral = SonarCloud Code Analysis
        • check-skipped = SonarCloud Code Analysis

@giancarloromeo
Copy link
Copy Markdown
Contributor Author

@mrnicegyu11 review, bitte

Copy link
Copy Markdown
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thx

@giancarloromeo giancarloromeo merged commit 018115f into ITISFoundation:master Apr 23, 2026
146 of 148 checks passed
@giancarloromeo giancarloromeo deleted the refactor/use-notification-service-for-emails-in-payments branch April 23, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:notifications a:payments area: payments service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants